/*涨球知识库目录接口*/

import http from '@/utils/request.js'

export default {
    add: {
        name: '添加',
        url: `${import.meta.env.VITE_API_URL}/catalog/create`,
        async post (data) {
            return await http.post(this.url, data)
        }
    },

    update: {
        name: '更新',
        url: `${import.meta.env.VITE_API_URL}/catalog/update`,
        async post (data) {
            return await http.post(this.url, data)
        }
    },

    delete: {
        name: '删除',
        url: `${import.meta.env.VITE_API_URL}/catalog/delete`,
        async post (data) {
            return await http.post(this.url, data)
        }
    },

    list: {
        name: '获取扁平列表',
        url: `${import.meta.env.VITE_API_URL}/catalog/list`,
        async get (data) {
            return await http.get(this.url, data)
        }
    },

    tree: {
        name: '获取树形列表',
        url: `${import.meta.env.VITE_API_URL}/catalog/listTree`,
        async get (data) {
            return await http.get(this.url, data)
        }
    },
}
